/**
 * fusionchart画图常用工具
 * 
 * @require jquery.js
 */
var fusionchartutil = fusionchartutil || {};

/**柱状图*/
fusionchartutil.column2dChart=function(divId,caption,yAxisName,xAxisName,data){
	var revenueChart = new FusionCharts({
        type: 'column2d',
        renderAt: divId,
        width: '100%',
        height: '250px',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": caption,
                "yAxisName":yAxisName,
                "bgColor": "#ffffff",
                "xAxisName": xAxisName,
                "theme":"fint",
                'formatNumberScale':"0",
                'rotateNames':"0",
                'showValues':"1",
                'rotateValues':"0"
                	
            },            
            "data": data
        }
    }).render();
};
/**饼图*/
fusionchartutil.pie2dChart=function(divId,caption,data){
	var revenueChart = new FusionCharts({
        type: 'pie2d',
        renderAt: divId,
        width: '100%',
        height: '250',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption":caption ,
                "bgcolor": "#ffffff",
                "showPercentInTooltip": "0",
                "decimals": "1",
                "theme": "fint",
                'formatNumberScale':"0"
            },
            "data": data
        }
    }).render();
	
};

/**折线图*/
fusionchartutil.alarmtrendstatsChart =function(divId,caption,colors,xdata,ydata){
	 var visitChart = new FusionCharts({
	        type: 'msline',
	        renderAt: divId,
	        width: '100%',
	        height: '270px',
	        dataFormat: 'json',
	        dataSource: {
	            "chart": {
	            	"labelStep":4,
	            	"showValues":0,
	                "caption":caption,
	                "captionFontSize": "14",
	                "subcaptionFontSize": "14",
	                "subcaptionFontBold": "0",
	                "paletteColors": colors,
	                "bgcolor": "#ffffff",
	                "theme":"fint",
	                'formatNumberScale':"0"
	            },
	            "categories": [
	                {
	                    "category": xdata
	                }
	            ],
	            "dataset": ydata
	        }
	    }).render();
};
/**环状饼图*/
fusionchartutil.doughnut2DChart=function(divId,caption,data){
	var revenueChart = new FusionCharts({
        type: 'doughnut2d',
        renderAt: divId,
        width: '100%',
        height: '250',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption":caption ,
                "bgcolor": "#ffffff",
                "showPercentInTooltip": "0",
                "decimals": "1",
                "theme": "fint",
                'formatNumberScale':"0"
            },
            "data": data
        }
    }).render();
	
};
